<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>字典目录管理</title>
    <#include "/common/link.ftl">

</head>
<body class="hold-transition skin-black sidebar-mini">
<div class="wrapper">
    <#include "/common/navbar.ftl">

    <#assign currentMenu="systemDictionary"/>

    <#include "/common/menu.ftl">
    <div class="content-wrapper">
        <section class="content-header">
            <h1>字典目录管理</h1>
        </section>
        <section class="content">

            <div class="box">
                <a href="#" class="btn btn-success btn-input" style="margin: 10px">
                    <span class="glyphicon glyphicon-plus"></span> 添加
                </a>
                <!--高级查询--->
                <form class="form-inline" id="searchForm" action="/systemDictionary/list" method="post">
                    <input type="hidden" name="currentPage" id="currentPage" value="1">
                </form>
                <!--编写内容-->
                <div class="box-body table-responsive">
                    <table class="table table-hover table-bordered table-striped">
                        <thead>
                            <tr>
                                <th>编号</th>
                                <th>字典目录标题</th>
                                <th>字典目录编码</th>
                                <th>字典目录简介</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <#list pageInfo.list as d>
                            <tr>
                                <td>${d.id}</td>
                                <td>${d.title}</td>
                                <td>${d.sn}</td>
                                <td>${d.intro}</td>
                                <td>
                                    <a href="#" class="btn btn-info btn-xs btn-input" data-json='${d}'>
                                        <span class="glyphicon glyphicon-pencil"></span> 编辑
                                    </a>
                                </td>
                            </tr>
                        </#list>
                        </tbody>
                    </table>
                    <#include "/common/page.ftl" >
                </div>
            </div>
        </section>
    </div>
    <#include "/common/footer.ftl" >
</div>

<form action="/systemDictionary/saveOrUpdate" method="post">
    <div id="myModal" class="modal fade" tabindex="-1" role="dialog">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">保存/修改</h4>
                </div>
                <input type="hidden" name="id">
                <div class="form-group">
                    <label for="exampleInputEmail1">&emsp;字典标题</label>
                    <input type="text" class="form-control" id="exampleInputEmail1" name="title" placeholder="请输入字典目录标题">
                </div>
                <div class="form-group">
                    <label for="exampleInputPassword1">&emsp;字典编码</label>
                    <input type="text" class="form-control" id="exampleInputPassword1" name="sn" placeholder="请输入字典目录编码">
                </div>
                <div class="form-group">
                    <label for="exampleInputPassword1">&emsp;字典简介</label>
                    <input type="text" class="form-control" id="exampleInputPassword1" name="intro" placeholder="请输入字典目录简介">
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-primary">保存操作</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
</form>

<script>
    $(".btn-input").click(function () {
        var data = $(this).data("json");
        if (data){
            $("input[name=title]").val(data.title);
            $("input[name=sn]").val(data.sn);
            $("input[name=id]").val(data.id);
            $("input[name=intro]").val(data.intro);
        }
        //弹出模态框
        $('#myModal').modal();
    })
</script>

</body>
</html>
